from bs4 import BeautifulSoup

class HtmlParserUtil:


    @classmethod
    def html_parser(cls,resp):
        # 1、提取html
        html = resp.json().get("description").get("form")
        # 2、获取bs对象
        bs = BeautifulSoup(html, "html.parser")
        # 3、提取url
        url = bs.form.get("action")
        data = {}
        # 4、查找所有的input标签
        for input in bs.find_all("input"):
            data[input.get("name")] = input.get("value")
        return url, data


